function getSum(arr) {
    var result = 0;
    for (var i = 0; i < arr.length; i++) {
        if (typeof arr[i] === 'number') {
            result += arr[i];
        } else {
            result += getSum(arr[i]);
        }
    }
    return result;
}

console.log(getSum([1, 2, [3, 4, [5, 6, [7, 8, [9, 10]]]]])); // 55
